package com.dreamchaser.familydevice.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author shajie
 * @since 2020-02-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class User extends Model<User> {


    private static final long serialVersionUID = -2862858798437086131L;
    /**
     * 主键
     */
    @TableId(value="id",type= IdType.AUTO)
    private Integer id;

    /**
     * 账号
     */
    @NotBlank(message="账号不能为空")
    @TableField("account")
    private String account;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @TableField("password")
    private String password;

    /**
     * 邮箱
     */
    @NotBlank(message = "邮箱不能为空")
    @TableField("email")
    private String email;

    /**
     * 关联家庭
     */
    @TableField("family_id")
    private Integer familyId;

    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空")
    @TableField("name")
    private String name;

    private String weChartId;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
